import en_US from "./en_US.ts";
import zh_CN from "./zh_CN.ts";
const sourceMap = {
    en_US,
    zh_CN
}
class i18n {
    static locale = "zh_CN";
    static localeData = {};
    static splitter = "";
    static init(locale: string = "zh_CN") {
        this.locale = locale;
        this.splitter = locale ==="en_US"? " " : "";
        this.localeData = sourceMap[locale];
    }
    static t(key: string | Array<string>) : string {
        if (Array.isArray(key)) {
            return key.map((k) => {
                return this.localeData[k]
            }).join(this.splitter)
        } else {
            return this.localeData[key]
        }
    }
}
export default i18n;